/********************************************************************
	created:	2011/9/5
	filename: 	Character.h
	author:		Mwolf
	
	purpose:	Definitions for characters in game
*********************************************************************/
#ifndef Character_h__
#define Character_h__

#include "Actor.h"
#include "2DSkeleton.h"
#include "TiledSolidGeometry.h"

#define PLATER_STATE_IDLE	1
#define PLATER_STATE_WALK	2
#define PLATER_STATE_JUMP	3
#define PLATER_STATE_DEAD	16

class Player;
class Patient;

Player* CreatePlayer();
Patient* CreatePatient();

enum ResourceStateEnum
{
	RES_INVALID_RESOURCE	= -1,
	RES_NOT_LOADED			= 0,
	RES_LOADED				= 1,
};

class Player : public Actor
{
	friend Player* CreatePlayer();
public:
	Player();

	virtual void Render();
	virtual void Update();

	virtual float GetSize() const;
	void Jump();

	void SetClimbingLadder(bool climbing) { m_ClimbingLadder = climbing; }
	bool IsClimbingLadder() { return m_ClimbingLadder; }

	void SetFacingLeft(bool facingLeft) {m_FacingLeft = facingLeft;}

private:

	void OnHitGround(GW_INT8 depth);

	void LoadResources();

	bool						m_CanJump;
	bool						m_ClimbingLadder;

	bool						m_FacingLeft;
	int							m_PlayerState;

	Vector2						m_LastSafePos;

	static float				m_sCharSize;
	static ResourceStateEnum	m_sResourceState;

	bool						m_SkeletonDisplay;
	Skeleton2D*					m_PlayerSkeleton;
};

class Patient : public Actor
{
	friend Patient* CreatePatient();
public:
	virtual void Render();
	virtual float GetSize() const;
	virtual void Interactive();

protected:
	Patient();
};

#endif // Character_h__
